public class Ex5_30{
	public static void main(String[] args){
		for (int i = 2; i < 998; i++){
			if (isPrime(i) && isPrime(i+2))
				System.out.printf("(%d, %d)\n", i, i+2);
		}
	}

	public static boolean isPrime(int number){
		boolean yes = true;
		for (int i = 2; i <= number/2; i++){
			if (number % i == 0){
				yes = false;
				break;
			}
		}
		return yes;
	}
}